#tag Class
Protected Class sjgText
	#tag Method, Flags = &h0
		Function Text() As String
		  Return Join( mChunkArray, "" )
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Append(s As String)
		  mChunkArray.Append s
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Clear()
		  Redim mChunkArray( -1 )
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Text(assigns s As String)
		  Redim mChunkArray( 0 )
		  mChunkArray( 0 ) = s
		  
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Prepend(s As String)
		  If UBound( mChunkArray ) = -1 then
		    mChunkArray.Append s
		  Else
		    mChunkArray.Insert( 0, s )
		  End If
		  
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Function Consolidate() As String
		  // Tidies up and returns the string
		  Dim s As String = Me.Text
		  
		  If UBound( mChunkArray ) > 0 Then
		    Me.Text = s
		  End If
		  
		  Return s
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Constructor()
		  
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Constructor(s As String)
		  Redim mChunkArray( 0 )
		  mChunkArray( 0 ) = s
		  
		End Sub
	#tag EndMethod


	#tag Property, Flags = &h21
		Private mChunkArray(-1) As String
	#tag EndProperty


	#tag ViewBehavior
		#tag ViewProperty
			Name="Name"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Index"
			Visible=true
			Group="ID"
			InitialValue="-2147483648"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Super"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Left"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Top"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
	#tag EndViewBehavior
End Class
#tag EndClass
